package constant

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

type Response struct {
	Code int    `json:"code"`
	Data any    `json:"data"`
	Msg  string `json:"msg"`
}

func SuccessResult(c *gin.Context, data any) {
	c.JSON(http.StatusOK, Response{
		Code: Success,
		Data: data,
		Msg:  GetErrorMsg(Success),
	})
}

func SuccessResultMsg(c *gin.Context) {
	c.JSON(http.StatusOK, Response{
		Code: Success,
		Data: nil,
		Msg:  GetErrorMsg(Success),
	})
}
func SuccessResultMessage(c *gin.Context, message string) {
	c.JSON(http.StatusOK, Response{
		Code: Success,
		Data: nil,
		Msg:  message,
	})
}
